package org.linlinjava.litemall.wx.web;

import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.DevicesGoods;
import org.linlinjava.litemall.db.domain.DevicesRecord;
import org.linlinjava.litemall.db.service.DevicesGoodsService;
import org.linlinjava.litemall.db.service.DevicesRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/wx/device/goods")
public class DevicesGoodsController {

    @Autowired
    private DevicesGoodsService goodsService;



    @GetMapping("/{id}")
    public Object getById(@PathVariable Integer id) {
        return ResponseUtil.ok(goodsService.selectById(id));
    }

    @PostMapping("/create")
    public Object create(@RequestBody DevicesGoods goods) {
        return ResponseUtil.ok(goodsService.insert(goods));
    }

    @GetMapping("/getAll")
    public Object getAll() {
        return ResponseUtil.ok(goodsService.getAll());
    }

}